function Img2 = shiftImg( Img, dx, dy )
%SHIFTIMG posune obrazek o dx a dy
%         Img2 ma stejne rozmery jako Img

[SizeY, SizeX] = size(Img);
Img2 = zeros(size(Img));
if dx > 0
    X = 1:(SizeX-dx);
    X2 = (1+dx):SizeX;    
else
    X = (1-dx):SizeX;
    X2 = 1:(SizeX+dx);   
end
if dy > 0
    Y = 1:(SizeY-dy);
    Y2 = (1+dy):SizeY;
else
    Y = (1-dy):SizeY;
    Y2 = 1:(SizeY+dy);    
end
Img2(Y2,X2) = Img(Y,X);
end

